package com.solo.services;

import org.springframework.stereotype.Service;

/*
 * FileName: BlogService.java
 * Description: 博客服务 - 使用构造方法注入
 * Author:   woolflighthouse@163.com
 * Date:     2025-11-19 17:39
 */
@Service
public class BlogService {
    private final String defaultAuthor;

    // 构造方法注入：强制依赖
    public BlogService() {
        this.defaultAuthor = "系统管理员";
        System.out.println("BlogService 已创建，默认作者: " + defaultAuthor);
    }

    public void createBlog(String blogName) {
        System.out.println("创建博客:");
        System.out.println("  博客名称: " + blogName);
        System.out.println("  作者: " + defaultAuthor);
        System.out.println("  创建时间: " + java.time.LocalDateTime.now());
    }
}
